import * as Vue from "vue";
//@ts-ignore
import { eventtarget } from "./eventtarget.ts"; //@ts-ignore
import { getabsolutecatalogue } from "./getbaseurl";
//@ts-ignore
import init_sidebar_section from "./init_sidebar_section.cjs";
//@ts-ignore
import { resolvemdpathfromurl } from "./resolvemdpathfromurl";
//@ts-ignore
import { routerpagegethandler } from "./routerpageget";

export async function initialize() {
    // const summaryfile = getabsolutecatalogue();
    // const path = resolvemdpathfromurl();
    // if (Object.is(path, summaryfile)) {
    await init_sidebar_section();
    await routerpagegethandler();
    // } else {
    //     await Promise.all([init_sidebar_section(), routerpagegethandler()]);
    // }

    await Vue.nextTick();
    requestAnimationFrame(() => {
        //@ts-ignore
        requestIdleCallback(() => {
            eventtarget.dispatchEvent(new Event("load"));
        });
    });
}
